package com.hdyg.sixg.adapter;

import android.support.annotation.Nullable;
import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hdyg.sixg.R;
import com.hdyg.sixg.entry.CountryBean;
import com.hdyg.sixg.util.ImageLoadUtil;

import java.util.List;

/**
 * @author CZB
 * @describe 凭证
 * @time 2019/3/20 14:22
 */
public class CertifAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public final static int IMAGE_MAX_NUMBER = 1;//最大图片张数
    private boolean IS_HIDE_DELETE_IMG = false;

    public CertifAdapter(int layoutResId, @Nullable List<String> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        if (IS_HIDE_DELETE_IMG) {
            helper.setVisible(R.id.ivDelete, false);
        }
        if (!TextUtils.isEmpty(item)) {
            ImageLoadUtil.imageLoad(mContext, item, helper.getView(R.id.ivImage));
            helper.addOnClickListener(R.id.ivDelete);
        }
    }

    //设置隐藏删除按钮  true隐藏 false不隐藏
    public void setHideDeleteImg(boolean flag) {
        IS_HIDE_DELETE_IMG = flag;
    }
}
